import storage from './storage.js'
import { tokenKey } from './constant'

const cache = {
  // token
  setToken(data) {
    storage.setItem(tokenKey, data);
  },
  getToken(data) {
    return storage.getItem(tokenKey);
  },
  // token
  setUserInfo(data) {
    storage.setItem('userInfo', data);
  },
  getUserInfo() {
    return storage.getItem('userInfo');
  }
};

export default cache;
